﻿<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8" />

    <title>犯贱志</title>
    <meta name="viewport" content="width=device-width,inital-scale=1.0,minimum-scale=1.0,maximum-scake=1.0" />
    <meta name="apple-mobile-web-app-title" content="犯贱志">

    <link href="fjzm-basic.css" rel="stylesheet" />

    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

    <script src="jquery-1.8.0.min.js"></script>

    <script>

        function GetQueryString(name) {

            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");

            var r = window.location.search.substr(1).match(reg);

            if (r != null) return unescape(r[2]); return null;

        }

        function render(data) {

            var a = data.indexOf('</header>');

            var b = data.indexOf('<footer');

            var str = data.substring(a + 9, b);



            $('#test2').html(str);

            var str2 = $('#test2 #gototop').html();

            $('#test2').html('');

            $('#gototop').html(str2);

            $('#gototop div.ui-box.mt10,#gototop div.ui-box.ui-imgswiper,#gototop div.ui-box nav').remove();



            $('img.lazy').each(function () {

                this.src = $(this).data('src');

            });

            $('a').each(function () {
                var a = this.href.indexOf("/post/");
                if (a >= 0) {
                    var code = this.href.substring(a + 6);
                    this.href = "fanjian2.html?code=" + code;
                }

                this.target = "_blank";

            })

            $('#btn_prev,#btn_next,#btn_first').each(function () {

                this.target = "_self";

            })

        }

        var page = parseInt(GetQueryString("page"));

        if (!page) {

            page = 1;

        }



        function gotopage() {

            $('#gototop').html('');

            jQuery.get("fanjianServlet?page=" + page, function (data) {

                render(data);

            });

        }

        gotopage();



        $(function () {

            $('#span_page').html(page);

            if (page > 1) {

                $('#btn_prev')[0].href = "fanjian.html?page=" + (page - 1);

            } else {

                $('#btn_prev,#btn_first').remove();

            }

            $('#btn_next')[0].href = "fanjian.html?page=" + (page + 1);



        });



    </script>

    <style>


        #test2 {
            width: 100%;
            display: none;
        }

        .ui-body {
            width: 95% !important;
            max-width: 5000px !important;
            margin: 0 auto;
            padding: 0px !important;
        }

    </style>

</head>
<body>
    <div id="test2">
    </div>
    <div class="ui-body" id="gototop">

    </div>
    <div id="end" style="padding-top:50px;padding-bottom:30px;">			<a id="btn_first" style="font-size:28px;" href="fanjian.html">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a id="btn_prev" style="font-size:28px;">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <span id="span_page" style="font-size:28px;">1</span>&nbsp;&nbsp;&nbsp;&nbsp;
        <a id="btn_next" style="font-size:28px;">下一页</a>
    </div>
</body>
</html>
